package com.ebanma.cloud.user.strategy;

import com.ebanma.cloud.dto.AjaxResult;
import com.ebanma.cloud.dto.UserDTO;
import com.ebanma.cloud.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class UsernameStrategy extends BaseLoginStrategy {
    @Autowired
    private IUserService iUserService;
    @Override
    public AjaxResult grant(UserDTO userDTO) {
        // 按照账号密码进行登录
        return iUserService.loginByUserName(userDTO);
    }
}
